package com.lerarneurekacheckinvoke.eurekacheckinvoke.common;

import com.lerarneurekacheckinvoke.eurekacheckinvoke.dao.doLogin;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class exceptionDologin implements FallbackFactory<doLogin> {
    @Override
    public doLogin create(Throwable throwable) {
        return new doLogin() {
            @Override
            public Result doLogin(String account, String password) {
                Result result=new Result();
                result.setMessage(throwable.getCause().toString()+"登录接口繁忙");
                return result;
            }

            @Override
            public Result logout(String token) {
                Result result=new Result();
                result.setMessage(throwable.getCause().toString()+"注销服务繁忙");
                return result;
            }
        };
    }
}
